<?php

/**
 * @Author: DEEP-2018BRTYLP\Administrator
 * @Date:   2019-03-19 15:17:42
 * @Last Modified by:   DEEP-2018BRTYLP\Administrator
 * @Last Modified time: 2019-03-30 15:49:50
 */
namespace app\api\controller;
use app\common\model\Version;
use fast\Random;
use think\Config;
use app\api\controller\Base;
/**
 * 获取基本配置信息
 */
class Option extends Base
{
	/*
		获取基本信息
	 */ 
	public function get_option()
	{	
		$map['status'] = 'normal';
		$age = db('age')->where($map)->order('id desc')->cache(true,60)->select();
		$car = db('car')->where($map)->order('id desc')->cache(true,60)->select();
		$height = db('height')->where($map)->order('id desc')->cache(true,60)->select();
		$house = db('house')->where($map)->order('id desc')->cache(true,60)->select();
		$income = db('income')->where($map)->order('id desc')->cache(true,60)->select();
		$marriage = db('marriage')->where($map)->order('id desc')->cache(true,60)->select();
		$tags = db('tags')->where($map)->order('id desc')->cache(true,60)->select();
		$weight = db('weight')->where($map)->order('id desc')->cache(true,60)->select();
		$zodiac = db('zodiac')->where($map)->order('id desc')->cache(true,60)->select();
		$data['age'] = $age;
		$data['car'] = $car;
		$data['height'] = $height;
		$data['house'] = $house;
		$data['income'] = $income;
		$data['marriage'] = $marriage;
		$data['tags'] = $tags;
		$data['weight'] = $weight;
		$data['zodiac'] = $zodiac;
		if($data){
			return $this->return_success('获取数据',$data,1);
		}else{
			return $this->return_error('暂无数据',[],0);
		}
	}

	/**
	 * 获取单页面信息
	 */
	public function get_page()
	{	
		$mark = input('param.mark','company_introduction');//标识
		$map['status'] = 1;
		$map['mark'] = $mark;
		$data = db('page')->where($map)->find();
		if($data){
			return $this->return_success('获取数据',$data,1);
		}else{
			return $this->return_error('暂无数据',[],0);
		}
	}
}
